/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.sql.Clob;
import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "PUB_DQGZ")
public class PubDqgz extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "党群工作";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_BT = "标题";
	public static final String ALIAS_ZT = "主题";
	public static final String ALIAS_LB = "类别";
	public static final String ALIAS_FBSJ = "发布时间";
	public static final String ALIAS_TYPE = "类型（1动态 2知识）";
	public static final String ALIAS_NR = "内容";
	public static final String ALIAS_FBR = "发布人";
	public static final String ALIAS_FBBM = "发布部门";
	
	//date formats
	public static final String FORMAT_FBSJ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	@Length(max=32)
	private java.lang.String id;
    /**
     * 标题       db_column: BT 
     */ 	
	@Length(max=200)
	private java.lang.String bt;
    /**
     * 主题       db_column: ZT 
     */ 	
	
	private Long zt;
    /**
     * 类别       db_column: LB 
     */ 	
	
	private Long lb;
    /**
     * 发布时间       db_column: FBSJ 
     */ 	
	
	private java.util.Date fbsj;
    /**
     * 类型（1动态 2知识）       db_column: TYPE 
     */ 	
	@Max(127)
	private Integer type;
    /**
     * 内容       db_column: NR 
     */ 	
	@Length(max=4000)
	private Clob nr;
    /**
     * 发布人       db_column: FBR 
     */ 	
	
	private Long fbr;
    /**
     * 发布部门       db_column: FBBM 
     */ 	
	@Length(max=50)
	private java.lang.String fbbm;
	//columns END


	public PubDqgz(){
	}

	public PubDqgz(
		java.lang.String id
	){
		this.id = id;
	}

	

	public void setId(java.lang.String value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "uuid.hex")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 32)
	public java.lang.String getId() {
		return this.id;
	}
	
	@Column(name = "BT", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getBt() {
		return this.bt;
	}
	
	public void setBt(java.lang.String value) {
		this.bt = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getZt() {
		return this.zt;
	}
	
	public void setZt(Long value) {
		this.zt = value;
	}
	
	@Column(name = "LB", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getLb() {
		return this.lb;
	}
	
	public void setLb(Long value) {
		this.lb = value;
	}
	
	@Transient
	public String getFbsjString() {
		return DateConvertUtils.format(getFbsj(), FORMAT_FBSJ);
	}
	public void setFbsjString(String value) {
		setFbsj(DateConvertUtils.parse(value, FORMAT_FBSJ,java.util.Date.class));
	}
	
	@Column(name = "FBSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getFbsj() {
		return this.fbsj;
	}
	
	public void setFbsj(java.util.Date value) {
		this.fbsj = value;
	}
	
	@Column(name = "TYPE", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getType() {
		return this.type;
	}
	
	public void setType(Integer value) {
		this.type = value;
	}
	
	@Column(name = "NR", unique = false, nullable = true, insertable = true, updatable = true, length = 4000)
	public Clob getNr() {
		return this.nr;
	}
	
	public void setNr(Clob value) {
		this.nr = value;
	}
	
	@Column(name = "FBR", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getFbr() {
		return this.fbr;
	}
	
	public void setFbr(Long value) {
		this.fbr = value;
	}
	
	@Column(name = "FBBM", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getFbbm() {
		return this.fbbm;
	}
	
	public void setFbbm(java.lang.String value) {
		this.fbbm = value;
	}
	
	
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Bt",getBt())
			.append("Zt",getZt())
			.append("Lb",getLb())
			.append("Fbsj",getFbsj())
			.append("Type",getType())
			.append("Nr",getNr())
			.append("Fbr",getFbr())
			.append("Fbbm",getFbbm())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof PubDqgz == false) return false;
		if(this == obj) return true;
		PubDqgz other = (PubDqgz)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	private String content;
	private String dataname;
	
	
	@Transient
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}
}


